package cn.kwq.project_manger.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckRole;
import cn.dev33.satoken.stp.StpUtil;
import cn.kwq.project_manger.common.R;
import cn.kwq.project_manger.common.RES;
import cn.kwq.project_manger.pojo.Role;
import cn.kwq.project_manger.service.RoleService;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

@Slf4j
@Api(tags ="权限服务")
@RestController
@RequestMapping("/role/")
@SaCheckLogin
@ApiIgnore
public class RoleController {
    @Autowired
    RoleService roleService;

    @ApiOperation("获取当前用户角色权限")
    @GetMapping("getRole")
    public RES getRole() {
        return R.ok(200,"当前用户权限列表",roleService.findRoleByUserId(StpUtil.getLoginIdAsLong()));

    }



}
